# encoding:utf-8
"""
@author: quanjie
@contact:
@time: 2022/1/7 3:43 PM
"""
import logging


class BaseCrawler(object):
    args = None
    kwargs = {}

    def __init__(self,*args,**kwargs):
        super().__init__()

    def execute(self, *args, **kwargs):
        self.args = args
        self.kwargs = kwargs
        try:
            self.before()
            self.run()
            self.close()
        except Exception as e:
            raise e
        finally:
            self.after()

    def before(self):
        pass

    def run(self):
        pass

    def after(self):
        pass

    def close(self):
        pass

